package com.qinggeng.project.system.domain.vo;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.qinggeng.common.utils.StringUtils;
import com.qinggeng.common.utils.spring.SpringUtils;
import com.qinggeng.common.utils.text.Convert;
import com.qinggeng.project.api.dto.DistributionPointDto;
import com.qinggeng.project.system.domain.DistributionPoint;
import com.qinggeng.project.system.domain.DistributionPointShopImg;
import com.qinggeng.project.system.domain.DistributionPointWxImg;
import com.qinggeng.project.system.domain.json.PointNameConfig;
import com.qinggeng.project.system.service.IDistributionPointService;
import com.qinggeng.project.system.service.ISysConfigService;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@Data
//用户展示配送点普通信息
public class DistributionPointVO   {

        private Long id;

        /**
         * 配送点名称
         */
        private String pointName;

        /**
         * 果果专员Id
         */
        private Long courierId;

        /**
         * 详细地址
         */
        private String address;

        private Float lng;

        private Float lat;

        /**
         * 配送时间
         */
        private String businessTime;

        /**
         * 配送下班时间
         */
        private String closingTime;

        /**
         * 距离
         */
        private Double distance;

        /**
         * 距离
         */
        private String distanceName = "";

        /**
         * 配送点电话
         */
        private String pointPhone;

        /**
         * 分拣区域
         **/
        private String sortArea;

        /**
         * 配送点编号
         **/
        private String sortAreaNum;

        //门头照
        private String pointImg;

        //环境照
        private String listImg;

        private String isOpen;

        private DistributionPointImgVO distributionPointImgVO;

        private String province;


        private String city;

        /**
         * 区域名称
         */
        private String area;


        private String delFalg;

        private String cityCode;

        //商户名称
        private String name;
        //查询条件
        private String queryName;

        private Long shopId;

        public String getDistanceName() {
            return Convert.distanceChange(this.distance);
        }

        @JsonIgnore
        private static final String DEFAULT_SUFFIX_NAME="生鲜馆";



        public String getPointName(){
            String suffixName=SpringUtils.getBean(IDistributionPointService.class).getPointSuffixName(DEFAULT_SUFFIX_NAME);
            return this.pointName+suffixName;
        }

        public DistributionPointImgVO getDistributionPointImgVO() {
            return this.distributionPointImgVO = new DistributionPointImgVO(this.pointImg, this.listImg);
        }
}
